package com.xmut.mall.member.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xmut.mall.member.dto.EvaluationQueryParams;
import com.xmut.mall.member.entity.MemberEvaluationEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface MemberEvaluationDao extends BaseMapper<MemberEvaluationEntity> {
    /**
     * 获取评论的分页数据
     * @param initPage
     * @param params
     * @return
     */
    IPage<MemberEvaluationEntity> getEvaluationPage(Page<Object> initPage,@Param("params") EvaluationQueryParams params);

    /**
     * 评论数量
     * @param id
     * @return
     */
    List<Map<String, Object>> getEvaluationNumber(@Param("goodsId") Long id);
}
